<%--
  Created by IntelliJ IDEA.
  User: 10330
  Date: 2021/7/1
  Time: 13:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/pages/common/header.jsp"%>

<script>
    $(document).ready(function(){
        $("#cate${param.cateId}").attr('class','list-group-item active');
    });
</script>

<div class="row"  style="border:0px solid red">
    <div class="col-md-2">
        <div class="row">
            <ul  class="list-group"  id="left_cate">
                <c:forEach items="${categoryDetailListForHeader}" var="categoryDetail">
                    <c:forEach items="${categoryDetail.childList}" var="child">
                        <a id="cate${child.childId}" href="${pageContext.request.contextPath}/goods?action=goodsCate&cateId=${child.childId}" class="list-group-item">${child.childName}</a>
                    </c:forEach>
                </c:forEach>
            </ul>
        </div>
    </div>
    <div class="col-md-10">
        <div class="row">
            <c:if test="${!empty goodsList }">
                <c:forEach items="${goodsList}" var="goods">
                    <div class="col-md-4">
                        <div class="thumbnail">
                            <a href="${pageContext.request.contextPath}/goods?action=goodsDetail&goodsId=${goods.goods_id}">
                                <img style="height: 220px" alt="${goods.goods_name}" src="${pageContext.request.contextPath}${goods.goods_pic}" />
                            </a>

                            <div class="caption text-center">
                                <label>
                                        ${goods.goods_name}
                                </label>
                                <p>
                                    原价<span class="glyphicon glyphicon-yen" aria-hidden="true"></span>${goods.goods_price}
                                    <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
                                </p>
                                <p>
                                    现售<span class="label label-pill label-info"><span class="glyphicon glyphicon-yen" aria-hidden="true"></span>${goods.goods_discount}</span>
                                </p>
                                <p>
                                    共售出${goods.goods_sales}件
                                </p>
                                <p>
                                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/goods?action=goodsDetail&goodsId=${goods.goods_id}" >查看详情</a>

                                </p>
                            </div>
                        </div>
                    </div>
                </c:forEach>
            </c:if>
            <c:if test="${empty goodsList}">
                <div class="alert alert-danger col-md-2" role="alert">对不起，暂无此类商品</div>
            </c:if>
        </div>
    </div>
</div>

<%@include file="/pages/common/footer.jsp"%>